package com.ywq.app.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class AdminRole implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7199666062229076268L;
	private String id;
	private String name;
	private String module;
	private String description;
	private boolean enabled;
	private Date gmtCreated;
	private Date gmtModified;
	
	private boolean isRole = false;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getModule() {
		return module;
	}

	public void setModule(String module) {
		this.module = module;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public Date getGmtCreated() {
		return gmtCreated;
	}

	public void setGmtCreated(Date gmtCreated) {
		this.gmtCreated = gmtCreated;
	}

	public Date getGmtModified() {
		return gmtModified;
	}

	public void setGmtModified(Date gmtModified) {
		this.gmtModified = gmtModified;
	}
	//设置用户的角色
	public static void isRole(List<AdminRole> roles, List<AdminRole> adminRoles) {
		if(roles==null||adminRoles==null || roles.size()==0 || adminRoles.size()==0){
			return;
		}
		for(AdminRole r : roles){
			for(AdminRole ar : adminRoles){
				if(ar.getId().equals(r.getId())){
					r.isRole = true;
				}
			}
		}
	}
	
	public boolean getIsRole() {
		return isRole;
	}
	
}
